<?php

namespace app\admin\model\validate;

use think\Validate;

class AppletImg extends Validate {
    protected $rule =   [
        'applet_id'  => 'require|number|unique:applet_img',
        'applet_name'  => 'require|unique:applet_img',
        'applet_app_id'  => 'max:125',
        //'open_id' => 'require',
        'applet_img' => 'require|max:225',
        'original_id' => 'require|max:125',
    ];

    protected $message  =   [
        'applet_id.require' => '小程序ID不能为空',
        'applet_id.unique' => '小程序已经存在',
        'applet_id.number' => '小程序ID必须是正整数',
        'applet_name.require' => '该小程序名称不能为空',
        'applet_name.unique' => '该小程序已经存在',
        'applet_app_id.max' => '小程序的app_id不能超过125个字符',
        'original_id.max'     => '原始ID不能超过125个字符',
        'applet_img.max'     => '小程序头像地址不能超过255个字符',
        'applet_img.require'     => '小程序头像不能为空',
    ];

    protected $scene = [
        /*'add'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],
        'edit'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],*/
    ];
}